<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>派车单管理</title>
	<meta name="decorator" content="ani"/>
	<style>
		#searchresult
		{
			width: 260px;
			position: absolute;
			z-index: 1;
			overflow: hidden;
			left: 140px;
			top: 71px;
			background: #E0E0E0;
			border-top: none;

		}
		#searchresult1
		{
			width: 260px;
			position: absolute;
			z-index: 1;
			overflow: hidden;
			left: 140px;
			top: 71px;
			background: #E0E0E0;
			border-top: none;

		}
		#searchresult2
		{
			width: 260px;
			position: absolute;
			z-index: 1;
			overflow: hidden;
			left: 140px;
			top: 71px;
			background: #E0E0E0;
			border-top: none;

		}
		#searchresult3
		{
			width: 260px;
			position: absolute;
			z-index: 1;
			overflow: hidden;
			left: 140px;
			top: 71px;
			background: #E0E0E0;
			border-top: none;

		}
		#searchresult4
		{
			width: 260px;
			position: absolute;
			z-index: 1;
			overflow: hidden;
			left: 140px;
			top: 71px;
			background: #E0E0E0;
			border-top: none;

		}

		.line
		{
			font-size: 15px;
			background: #E0E0E0;
			width: 140px;
			padding:0px;
		}
		.hover
		{
			background: #007ab8;
			width: 140px;
			color: #fff;
		}
		.std
		{
			width: 150px;
		}
	</style>
	<script type="text/javascript">
		var validateForm;
		var $table; // 父页面table表格id
		var $topIndex;//弹出窗口的 index
		function doSubmit(table, index){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $table = table;
			  $topIndex = index;
			  jp.loading();
			  $("#inputForm").submit();
			  return true;
		  }

		  return false;
		}

		$(document).ready(function() {

            $.ajax({
                url : "${ctx}/ap/card/li",
                type:'post',
                success : function(data) {
                    $("#ykkh").empty();
                    $("#ykkh").append("<option value=''>请选择</option>");
                    $.each(JSON.parse(data), function (idx, item) {
                        $("#ykkh").append("<option value='"+item.number+"'>"+item.number+"</option>");
                    })
                },
                error : function(data){
                    alert("操作失败!");
                }
            });
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					jp.post("${ctx}/tms/dispatching/save1",$('#inputForm').serialize(),function(data){
						if(data.success){
	                    	$table.bootstrapTable('refresh');
	                    	jp.success(data.msg);
	                    	jp.close($topIndex);//关闭dialog

	                    }else{
            	  			jp.error(data.msg);
	                    }
					})
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
		});
        $("#searchresult3").bind("mouseleave", function () {
            $("#searchresult3").empty();
            $("#searchresult3").css("display", "none");
        });
        function ChangeCoords3() {
            //    var left = $("#txt_search")[0].offsetLeft; //获取距离最左端的距离，像素，整型
            //    var top = $("#txt_search")[0].offsetTop + 26; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            var left = $("#payeeName").position().left; //获取距离最左端的距离，像素，整型
            var top = $("#payeeName").position().top + 30; ; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            $("#searchresult3").css("left", left + "px"); //重新定义CSS属性
            $("#searchresult3").css("top", top + "px"); //同上
        }
        function cx(evt) {
            ChangeCoords3(); //控制查询结果div坐标
            var k = window.event ? evt.keyCode : evt.which;
            //输入框的id为txt_search，这里监听输入框的keyup事件
            //不为空 && 不为上箭头或下箭头或回车
            if ($("#payeeName").val() != "" &&  k == 13) {
                $.ajax({
                    type: 'post',
                    async: true, //同步执行，不然会有问题
                    dataType: "json",
                    url: "${ctx}/infor/account/getByName?name="+$("#payeeName").val(),
                    //提交的页面/方法
                    error: function (msg) {//请求失败处理函数
                        jp.error("数据加载失败");
                    },
                    success: function (data) { //请求成功后处理函数。
						/*  var objData = eval("(" + data.userName + ")");   */
                        console.log(data);
                        if (data.length > 0) {
                            var layer = "";
                            layer = "<table id='aa3'>";
                            $.each(data, function (idx, item) {
                                layer += "<tr class='line3' title='"+item.name+"' name='"+item.code+"' id='"+item.bank+"'><td class='std'>" + item.name+"-"+item.code+ "</td></tr>";
                            });
                            layer += "</table>";
                            //将结果添加到div中
                            $("#searchresult3").empty();
                            $("#searchresult3").append(layer);
                            $(".line:first").addClass("hover");
                            $("#searchresult3").css("display", "");
                            //鼠标移动事件

                            $(".line3").hover(function () {
                                $(".line3").removeClass("hover");
                                $(this).addClass("hover");
                            }, function () {
                                $(this).removeClass("hover");
                                //$("#searchresult").css("display", "none");
                            });
                            //鼠标点击事件
                            $(".line3").click(function () {
                                $("#payeeName").val($(this).attr("title"));
                                $("#khh").val($(this).attr("id"));
                                $("#kh").val($(this).attr("name"));
                                $("#searchresult3").css("display", "none");
                            });
                        } else {
                            $("#searchresult3").empty();
                            $("#searchresult3").css("display", "none");
                        }
                    }
                });
            }
            else if (k == 38) {//上箭头
                $('#aa tr.hover').prev().addClass("hover");
                $('#aa tr.hover').next().removeClass("hover");
                $('#payeeName').val($('#aa tr.hover').attr("title"));
            }
            else if (k == 40) {//下箭头
                $('#aa tr.hover').next().addClass("hover");
                $('#aa tr.hover').prev().removeClass("hover");
                $('#payeeName').val($('#aa tr.hover').attr("title"));
            }

            else {
                $("#searchresult3").empty();
                $("#searchresult3").css("display", "none");
            }
        };
        function cxyk(evt) {
            ChangeCoords4(); //控制查询结果div坐标
            var k = window.event ? evt.keyCode : evt.which;
            //输入框的id为txt_search，这里监听输入框的keyup事件
            //不为空 && 不为上箭头或下箭头或回车
            if ($("#ykkh").val() != "" &&  k == 13) {
                $.ajax({
                    type: 'post',
                    async: true, //同步执行，不然会有问题
                    dataType: "json",
                    url: "${ctx}/ap/card/getByName?name="+$("#ykkh").val(),
                    //提交的页面/方法
                    error: function (msg) {//请求失败处理函数
                        jp.error("数据加载失败");
                    },
                    success: function (data) { //请求成功后处理函数。
						/*  var objData = eval("(" + data.userName + ")");   */
                        console.log(data);
                        if (data.length > 0) {
                            var layer = "";
                            layer = "<table id='aa4'>";
                            $.each(data, function (idx, item) {
                                layer += "<tr class='line4' title='"+item.number+"' ><td class='std'>" + item.number+ "</td></tr>";
                            });
                            layer += "</table>";
                            //将结果添加到div中
                            $("#searchresult4").empty();
                            $("#searchresult4").append(layer);
                            $(".line:first").addClass("hover");
                            $("#searchresult4").css("display", "");
                            //鼠标移动事件

                            $(".line4").hover(function () {
                                $(".line4").removeClass("hover");
                                $(this).addClass("hover");
                            }, function () {
                                $(this).removeClass("hover");
                                //$("#searchresult").css("display", "none");
                            });
                            //鼠标点击事件
                            $(".line4").click(function () {
                                $("#ykkh").val($(this).attr("title"));

                                $("#searchresult4").css("display", "none");
                            });
                        } else {
                            $("#searchresult4").empty();
                            $("#searchresult4").css("display", "none");
                        }
                    }
                });
            }
            else if (k == 38) {//上箭头
                $('#aa tr.hover').prev().addClass("hover");
                $('#aa tr.hover').next().removeClass("hover");
                $('#ykkh').val($('#aa tr.hover').attr("title"));
            }
            else if (k == 40) {//下箭头
                $('#aa tr.hover').next().addClass("hover");
                $('#aa tr.hover').prev().removeClass("hover");
                $('#ykkh').val($('#aa tr.hover').attr("title"));
            }

            else {
                $("#searchresult4").empty();
                $("#searchresult4").css("display", "none");
            }
        };
        $("#searchresult4").bind("mouseleave", function () {
            $("#searchresult4").empty();
            $("#searchresult4").css("display", "none");
        });
        function ChangeCoords4() {
            //    var left = $("#txt_search")[0].offsetLeft; //获取距离最左端的距离，像素，整型
            //    var top = $("#txt_search")[0].offsetTop + 26; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            var left = $("#ykkh").position().left; //获取距离最左端的距离，像素，整型
            var top = $("#ykkh").position().top + 30; ; //获取距离最顶端的距离，像素，整型（20为搜索输入框的高度）
            $("#searchresult4").css("left", left + "px"); //重新定义CSS属性
            $("#searchresult4").css("top", top + "px"); //同上
        }
        function bb() {
            var a=$("#zhfkxj").val();
            var a1=$("#zhfkyk").val();
            var b=$("#hdfkxj").val();
            var b1=$("#hdfkyk").val();
            var c=$("#hzfkxj").val();
            var c1=$("#hzfkyk").val();
            if(a==null||a==""){
                a="0";
            }
            if(a1==null||a1==""){
                a1="0";
            }
            if(b==null||b==""){
                b="0";
            }
            if(b1==null||b1==""){
                b1="0";
            }
            if(c==null||c==""){
                c="0";
            }if(c1==null||c1==""){
                c1="0";
            }
            $("#hdfk").val(parseInt(b)+parseInt(b1));
            $("#hzjs").val(parseInt(c)+parseInt(c1));
            $("#zhfk").val(parseInt(a)+parseInt(a1));
            $("#zxj").val(parseInt(c)+parseInt(b)+parseInt(a));
            $("#zyk").val(parseInt(c1)+parseInt(b1)+parseInt(a1));
            $("#zyf").val(parseInt(a)+parseInt(a1)+parseInt(b)+parseInt(b1)+parseInt(c)+parseInt(c1));

        }
        function addRow(list, idx, tpl, row){
            $(list).append(Mustache.render(tpl, {
                idx: idx, delBtn: true, row: row
            }));
            $(list+idx).find("select").each(function(){
                $(this).val($(this).attr("data-value"));
            });
            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
                var ss = $(this).attr("data-value").split(',');
                for (var i=0; i<ss.length; i++){
                    if($(this).val() == ss[i]){
                        $(this).attr("checked","checked");
                    }
                }
            });
            $(list+idx).find(".form_datetime").each(function(){
                $(this).datetimepicker({
                    format: "YYYY-MM-DD HH:mm:ss"
                });
            });
        }
        function delRow(obj, prefix){
            var id = $(prefix+"_id");
            var delFlag = $(prefix+"_delFlag");
            if (id.val() == ""){
                $(obj).parent().parent().remove();
            }else if(delFlag.val() == "0"){
                delFlag.val("1");
                $(obj).html("&divide;").attr("title", "撤销删除");
                $(obj).parent().parent().addClass("error");
            }else if(delFlag.val() == "1"){
                delFlag.val("0");
                $(obj).html("&times;").attr("title", "删除");
                $(obj).parent().parent().removeClass("error");
            }
        }
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="dispatching" class="form-horizontal">
		<form:hidden path="id"/>
			<form:hidden path="jhl"/>
		<sys:message content="${message}"/>
			<ul class="nav nav-tabs">
				<li class="active"><a data-toggle="tab" href="#tab-01" aria-expanded="true">配载信息：</a>
				</li>
				<li class=""><a data-toggle="tab" href="#tab-02" aria-expanded="true">费用信息：</a>
				</li>
			</ul>
			<div class="tab-content">
				<div id="tab-01" class="tab-pane fade in  active">
					<table class="table table-bordered">
						<tbody>
						<tr>
							<td class="width-15 active"><label class="pull-right">绩效吨位区间：</label></td>
							<td class="width-35">
								<form:input path="jxdwqj" htmlEscape="false"    class="form-control "/>
							</td>
							<td class="width-15 active"><label class="pull-right">派车单号：</label></td>
							<td class="width-35">
								<form:input path="pcdh" htmlEscape="false"    class="form-control "/>
							</td>
						</tr>
						<tr>
							<td class="width-15 active"><label class="pull-right">调度人员：</label></td>
							<td class="width-35">
								<sys:gridselect url="${ctx}/infor/staff/data" id="ddry" name="ddry.id" value="${dispatching.ddry.id}" labelName="ddry.name" labelValue="${dispatching.ddry.name}"
												title="选择人员名称" cssClass="form-control required" fieldLabels="名称" fieldKeys="name" searchLabels="名称" searchKeys="name" ></sys:gridselect>
							</td>
							<td class="width-15 active"><label class="pull-right">现场督导：</label></td>
							<td class="width-35">
								<sys:gridselect url="${ctx}/infor/staff/data" id="xxdd" name="xxdd.id" value="${dispatching.xxdd.id}" labelName="xxdd.name" labelValue="${dispatching.xxdd.name}"
												title="选择人员名称" cssClass="form-control required" fieldLabels="名称" fieldKeys="name" searchLabels="名称" searchKeys="name" ></sys:gridselect>
							</td>
						</tr>
						<tr>
							<td class="width-15 active"><label class="pull-right">托运类型：</label></td>
							<td class="width-35">
								<form:input path="tylx" htmlEscape="false"    class="form-control "/>
							</td>
							<td class="width-15 active"><label class="pull-right">承运商：</label></td>
							<td class="width-35">
								<form:input path="cys" htmlEscape="false"    class="form-control "/>
							</td>
						</tr>
						<tr>
							<td class="width-15 active"><label class="pull-right">承运商联系人：</label></td>
							<td class="width-35">
								<form:input path="cyslxr" htmlEscape="false"    class="form-control "/>
							</td>
							<td class="width-15 active"><label class="pull-right">承运商电话：</label></td>
							<td class="width-35">
								<form:input path="cysdh" htmlEscape="false"    class="form-control "/>
							</td>
						</tr>
						<tr>
							<td class="width-15 active"><label class="pull-right">车牌号：</label></td>
							<td class="width-35">
								<form:input path="cph" htmlEscape="false"    class="form-control "/>

							</td>
							<td class="width-15 active"><label class="pull-right">车辆类型：</label></td>
							<td class="width-35">
								<form:input path="cllx" htmlEscape="false"    class="form-control "/>
							</td>
						</tr>
						<tr>
							<td class="width-15 active"><label class="pull-right">行驶证号：</label></td>
							<td class="width-35">
								<form:input path="xszh" htmlEscape="false"    class="form-control "/>
							</td>
							<td class="width-15 active"><label class="pull-right">司机姓名：</label></td>
							<td class="width-35">
								<form:input path="sjxm" htmlEscape="false"    class="form-control "/>
							</td>
						</tr>
						<tr>
							<td class="width-15 active"><label class="pull-right">司机电话：</label></td>
							<td class="width-35">
								<form:input path="sjdh" htmlEscape="false"    class="form-control "/>
							</td>
							<td class="width-15 active"><label class="pull-right">驾驶证号：</label></td>
							<td class="width-35">
								<form:input path="jszh" htmlEscape="false"    class="form-control "/>
							</td>
						</tr>
						</tbody>
					</table>
					<table class="table table-bordered">
						<thead>
						<tr>
							<th>运单号</th>
							<th>装运单号</th>
							<th>提货单号</th>
							<th>物料编码</th>
							<th>物料名称</th>
							<th>收货单位</th>
							<th>派车量</th>
							<th>装车量</th>
						</tr>
						</thead>
						<tbody>
						<c:forEach items="${list}" var="p">
							<tr>
								<td>${p.ydh}</td>
								<td>${p.zydh}</td>
								<td>${p.thdh}</td>
								<td>${p.code}</td>
								<td>${p.name.name}</td>
								<td>${p.shdw}</td>
								<td>${p.pcl}</td>
								<td><input name="${p.id}" value="${p.zcl}"/></td>
							</tr>
						</c:forEach>
						</tbody>
					</table>
				</div>
				<div id="tab-02" class="tab-pane fade ">
					<div style="height: 10px;"></div>
					<input onclick="addaccount()"  value="新增收款账户" type="button" class="btn-primary"/>
					<div style="height: 10px;"></div>
					<table class="table table-bordered">
						<tbody>
						<tr>
							<td class="width-8 active"><label class="pull-right">支付方式：</label></td>
							<td class="width-17">
								<form:select path="zffs" class="form-control ">
									<form:options items="${fns:getDictList('fkfs')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
								</form:select>

							</td>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>收款人姓名：</label></td>
							<td class="width-17">
								<input id="payeeName"  onkeyup="cx(event)"  autocomplete="off"  name="skr" value="${dispatching.skr}"   htmlEscape="false"    class="form-control required"/>
								<div id="searchresult3" style="display: none;"></div>							</td>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>卡号：</label></td>
							<td class="width-17">
								<form:input path="kh" htmlEscape="false"    class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>开户行：</label></td>
							<td class="width-17">
								<form:input path="khh" htmlEscape="false"    class="form-control required"/>
							</td>
						</tr>
						<tr>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>装货付款：</label></td>
							<td class="width-17">
								<form:input path="zhfk" htmlEscape="false" readonly="true"   class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>装货付款(现金)：</label></td>
							<td class="width-17">
								<form:input path="zhfkxj" htmlEscape="false"  onblur="bb()"   class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>装货付款(油卡)：</label></td>
							<td class="width-17">
								<form:input path="zhfkyk" htmlEscape="false"  onblur="bb()"   class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right">油卡卡号(装货)：</label></td>
							<td class="width-17">
								<form:input path="ykkh" htmlEscape="false"  onkeyup="cxyk(event)"  class="form-control"/>
								<div id="searchresult4" style="display: none;"></div>
							</td>

						</tr>
						<tr>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>货到付款：</label></td>
							<td class="width-17">
								<form:input path="hdfk" htmlEscape="false"  readonly="true"     class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>货到付款(现金)：</label></td>
							<td class="width-17">
								<form:input path="hdfkxj" htmlEscape="false"  onblur="bb()"   class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>货到付款(油卡)：</label></td>
							<td class="width-17">
								<form:input path="hdfkyk" htmlEscape="false"  onblur="bb()"   class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right">油卡卡号(货到)：</label></td>
							<td class="width-17">
								<form:input path="hdykkh" htmlEscape="false"  onkeyup="cxyk(event)"  class="form-control"/>
								<div id="searchresult4" style="display: none;"></div>
							</td>


						</tr>


						<tr>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>回执结算：</label></td>
							<td class="width-17">
								<form:input path="hzjs" htmlEscape="false" readonly="true"  class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>回执结算(现金)：</label></td>
							<td class="width-17">
								<form:input path="hzfkxj" htmlEscape="false"  onblur="bb()"   class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right"><span style="color: red">*</span>回执结算(油卡)：</label></td>
							<td class="width-17">
								<form:input path="hzfkyk" htmlEscape="false"  onblur="bb()"   class="form-control required"/>
							</td>
							<td class="width-8 active"><label class="pull-right">油卡卡号(回执)：</label></td>
							<td class="width-17">
								<form:input path="hzykkh" htmlEscape="false"  onkeyup="cxyk(event)"  class="form-control"/>
								<div id="searchresult4" style="display: none;"></div>
							</td>

						</tr>
						<tr>
							<td class="width-8 active"><label class="pull-right">总运费：</label></td>
							<td class="width-17">
								<form:input path="zyf" htmlEscape="false" readonly="true"   class="form-control "/>
							</td>
							<td class="width-8 active"><label class="pull-right">总现金：</label></td>
							<td class="width-17">
								<form:input path="zxj" htmlEscape="false" readonly="true"   class="form-control "/>
							</td>
							<td class="width-8 active"><label class="pull-right">总油卡：</label></td>
							<td class="width-17">
								<form:input path="zyk" htmlEscape="false" readonly="true"   class="form-control "/>
							</td>
							<td class="width-8 active"><label class="pull-right">无车承运平台单号：</label></td>
							<td class="width-17">
								<form:input path="wccyddh" htmlEscape="false"   class="form-control "/>
							</td>
						</tr>
						</tbody>
					</table>
					<div class="tabs-container">
						<ul class="nav nav-tabs">
							<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">附加费用：</a>
							</li>
						</ul>
						<div class="tab-content">
							<div id="tab-1" class="tab-pane fade in  active">
								<a class="btn btn-white btn-sm" onclick="addRow('#additionalChargesList', additionalChargesRowIdx, additionalChargesTpl);additionalChargesRowIdx = additionalChargesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
								<table class="table table-striped table-bordered table-condensed">
									<thead>
									<tr>
										<th class="hide"></th>
										<th>收支类型</th>
										<th>金额</th>
										<th>数量</th>
										<th>单价</th>
										<th>备注信息</th>
										<th width="10">&nbsp;</th>
									</tr>
									</thead>
									<tbody id="additionalChargesList">
									</tbody>
								</table>
								<script type="text/template" id="additionalChargesTpl">//<!--
				<tr id="additionalChargesList{{idx}}">
					<td class="hide">
						<input id="additionalChargesList{{idx}}_id" name="additionalChargesList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
						<input id="additionalChargesList{{idx}}_delFlag" name="additionalChargesList[{{idx}}].delFlag" type="hidden" value="0"/>
					</td>

					<td>
					<select id="additionalChargesList{{idx}}_balanceType" name="additionalChargesList[{{idx}}].balanceType" data-value="{{row.balanceType}}" class="form-control m-b  ">

							<c:forEach items="${fns:getDictList('fee_type')}" var="dict">
								<option value="${dict.value}">${dict.label}</option>
							</c:forEach>
						</select>
						<%--<input id="additionalChargesList{{idx}}_balanceType" name="additionalChargesList[{{idx}}].balanceType" type="text" value="{{row.balanceType}}"    class="form-control "/>--%>
					</td>


					<td>
						<input id="additionalChargesList{{idx}}_money" name="additionalChargesList[{{idx}}].money" type="text" value="{{row.money}}"    class="form-control "/>
					</td>


					<td>
						<input id="additionalChargesList{{idx}}_quantity" name="additionalChargesList[{{idx}}].quantity" type="text" value="{{row.quantity}}"    class="form-control "/>
					</td>


					<td>
						<input id="additionalChargesList{{idx}}_unit_price" name="additionalChargesList[{{idx}}].unit_price" type="text" value="{{row.unit_price}}"    class="form-control "/>
					</td>


					<td>
						<input id="additionalChargesList{{idx}}_remarks" name="additionalChargesList[{{idx}}].remarks" value="{{row.remarks}}"    class="form-control ">
					</td>

					<td class="text-center" width="10">
						{{#delBtn}}<span class="close" onclick="delRow(this, '#additionalChargesList{{idx}}')" title="删除">&times;</span>{{/delBtn}}
					</td>
				</tr>//-->
								</script>
								<script type="text/javascript">
                                    var additionalChargesRowIdx = 0, additionalChargesTpl = $("#additionalChargesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                                    $(document).ready(function() {
                                        var data = ${fns:toJson(dispatching.additionalChargesList)};
                                        for (var i=0; i<data.length; i++){
                                            addRow('#additionalChargesList', additionalChargesRowIdx, additionalChargesTpl, data[i]);
                                            additionalChargesRowIdx = additionalChargesRowIdx + 1;
                                        }
                                    });
								</script>
							</div>
						</div>
				</div>
			</div>

	</form:form>
</body>
</html>